package com.fansl.allround.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author fansl
 * @Description: 用户状态枚举类
 * @date 2019/10/10 12:08
 */
@Getter
@AllArgsConstructor
public enum UserStatusEnum {
    NORMAL(0,"正常"),
    LOCK(9,"已锁定");

    /**
     * 类型
     */
    private final int code;
    /**
     * 描述
     */
    private final String description;

    public static UserStatusEnum getByCode(int code){
        for (UserStatusEnum statusEnum:UserStatusEnum.values()){
            if(statusEnum.getCode()==code){
                return statusEnum;
            }
        }
        return NORMAL;
    }
}
